<?php
/**
 * Created by JetBrains PhpStorm.
 * User: shaoshuai
 * Date: 11-10-3
 * Time: PM4:03
 */

include_once '../common.func.php';

$settings = getSettings();

$key = trim($_POST['key']);
$value = trim($_POST['value']);

if ($_POST['action'] == '保存') {
    if ($settings[$key]) {
        $settings[$key] = $value;
        saveSettings($settings);
    }
} elseif ($_POST['action'] == '添加') {
    $settings[$key] = $value;
    saveSettings($settings);
}

header('Location: ../admin/setting.php');
